package com.qk.management.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qk.dto.operatelog.OperateLogDTO;
import com.qk.entity.OperateLog;
import com.qk.management.service.OperateLogService;
import com.qk.management.mapper.OperateLogMapper;
import com.qk.result.PageResult;
import com.qk.vo.operatelog.OperateLogVO;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author ZYZ
* @description 针对表【operate_log(操作日志表)】的数据库操作Service实现
* @createDate 2025-10-16 17:45:24
*/
@Service
public class OperateLogServiceImpl extends ServiceImpl<OperateLogMapper, OperateLog>
    implements OperateLogService{

    @Override
    public PageResult<OperateLogVO> getByPage(OperateLogDTO operateLogDTO) {
        PageHelper.startPage(operateLogDTO.getPage(), operateLogDTO.getPageSize());
        List<OperateLogVO> pageInfos = this.baseMapper.getLogByPage(operateLogDTO);

        PageInfo<OperateLogVO> pageInfo = new PageInfo<>(pageInfos);
        return PageResult.<OperateLogVO>builder()
                .total(pageInfo.getTotal())
                .rows(pageInfo.getList())
                .build();

    }
}




